﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="JumbotCms.WebFile.Admin._createhtml" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title></title>
<link type="text/css" rel="stylesheet" href="../../admin/otherpage/styles/common.css" />
<script type="text/javascript" src="../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="../../style/global.css" />
<script type="text/javascript" src="../../_libs/jquery.tabs.js"></script>
<script type="text/javascript">
            $(function() {
                $('#container-1').tabs({ fxFade: true, fxSpeed: 'fast' });
            });
    </script>
<link rel="stylesheet" href="../../_libs/jquery.tabs/style.css"
        type="text/css">
<!--[if lte IE 7]>
<link rel="stylesheet" href="../../_libs/jquery.tabs/style-ie.css" type="text/css">
<![endif]-->
<link type="text/css" rel="stylesheet" href="../../_libs/jquery.formvalidator/style.css" />
<script type="text/javascript" src="../../_libs/jquery.formvalidator.js"></script>

<script type="text/javascript">
$(document).ready(function(){
    if("<%=_Go2Create %>" == "false")
    {
        $("#table3").hide();
        $("#table4").hide();
    }
	$.formValidator.initConfig({onError:function(msg){}});
	$("#txtId1").formValidator({tipid:"tipId1",onshow:"请填写数字",onfocus:"请填写数字",oncorrect:""}).RegexValidator({regexp:"^\[0-9]+$",onerror:"请填写数字"});
	$("#txtId2").formValidator({tipid:"tipId2",onshow:"请填写数字",onfocus:"请填写数字",oncorrect:""}).RegexValidator({regexp:"^\[0-9]+$",onerror:"请填写数字"});
});
    </script>
<script type="text/javascript">
var ccid = joinValue('ccid');//频道ID
function ajaxCreateTOP10(act)
{
	JumbotCms.Loading.show("正在更新,请等待...");
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=createtop10&act="+act+ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				JumbotCms.Alert(d.returnval, "1");
				break;
			}
		}
	});
}
function ajaxCreateChannel()
{
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=createchannel"+ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown) { alert(XmlHttpRequest.responseText);},
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				JumbotCms.Alert(d.returnval, "1");
				break;
			}
		}
	});
}
function ajaxCreateByClass(act)
{
	JumbotCms.Loading.show("正在更新,请等待...");
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"classcode="+$("#ddlClass").val()+"&time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=createbyclass&act="+act+ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				JumbotCms.Alert(d.returnval, "1");
				break;
			}
		}
	});
}
function ajaxCreateById()
{
	JumbotCms.Loading.show("正在更新,请等待...");
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"id1="+$("#txtId1").val()+"&id2="+$("#txtId2").val()+"&time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=createbyid"+ccid,
		error:		function(XmlHttpRequest,textStatus, errorThrown){JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				JumbotCms.Alert(d.returnval, "1");
				break;
			}
		}
	});
}
</script>
</head>
<body>
<form id="form1" runat="server">
	<br />
	<div id="container-1">
		<ul>
			<li><a href="#fragment-1"><span>更新JS文件</span></a></li>
			<li><a href="#fragment-2"><span>更新静态页面</span></a></li>
		</ul>
		<div id="fragment-1">
			<table id="table1" cellspacing="0" cellpadding="0" width="100%" class="formtable">
				<tr>
					<th> 最新TOP 10 </th>
					<td><input id="button10_1" type="button" value="更新" class="btnsubmit" onclick="ajaxCreateTOP10('new')" />
					</td>
				</tr>
				<tr>
					<th> 推荐TOP 10 </th>
					<td><input id="button0_2" type="button" value="更新" class="btnsubmit" onclick="ajaxCreateTOP10('good')" />
					</td>
				</tr>
			</table>
		</div>
		<div id="fragment-2">
			<table id="table2" cellspacing="0" cellpadding="0" width="100%" class="formtable">
				<tr>
					<th> 更新频道首页 </th>
					<td><input id="button1" type="button" value="执行" class="btnsubmit" onclick="ajaxCreateChannel()" />
					</td>
				</tr>
			</table>
			<table id="table3" cellspacing="0" cellpadding="0" width="100%" class="formtable">
				<tr>
					<td colspan="2"><b>按栏目更新(自动更新子级栏目)</b> </td>
				</tr>
				<tr>
					<th> 选择栏目 </th>
					<td align="left"><asp:DropDownList ID="ddlClass" runat="server"> </asp:DropDownList>
					</td>
				</tr>
				<tr>
					<th> 更新列表页 </th>
					<td align="left"><input id="button2" type="button" value="执行" class="btnsubmit" onclick="ajaxCreateByClass('class')" />
					</td>
				</tr>
				<tr>
					<th> 更新内容页 </th>
					<td align="left"><input id="button3" type="button" value="执行" class="btnsubmit" onclick="ajaxCreateByClass('content')" />
					</td>
				</tr>
			</table>
			<table id="table4" cellspacing="0" cellpadding="0" width="100%" class="formtable">
				<tr>
					<td colspan="2"><b>按ID更新(输入起止ID号)</b> </td>
				</tr>
				<tr>
					<th> 开始ID </th>
					<td align="left"><asp:TextBox ID="txtId1" runat="server" Width="60px" ValidationGroup="id" CssClass="ipt"></asp:TextBox>
						<div class="ValidatorTip" id="tipId1" style="width:250px"></div></td>
				</tr>
				<tr>
					<th> 结束ID </th>
					<td><asp:TextBox ID="txtId2" runat="server" Width="60px" ValidationGroup="id" CssClass="ipt"></asp:TextBox>
						<div class="ValidatorTip" id="tipId2" style="width:250px"></div></td>
				</tr>
				<tr>
					<th> 更新内容页 </th>
					<td align="left"><input id="button4" type="button" value="执行" class="btnsubmit" onclick="if(jQuery.formValidator.PageIsValid('1')){ajaxCreateById();}" />
					</td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>
</html>
